require 'rexml/document'
require 'extract/extractor'

module Extract
  
  class XMLExtractor < Extract::Extractor
    
    def initialize(opt = {})
      super opt
    end
    
    protected
    
    def open_doc doc
      begin
        rdoc = REXML::Document.new doc
      rescue REXML::ParseException => e  
        #continue with a partial xml parsed document if possible
        raise e if rdoc.nil?   
      end
      rdoc
    end
  end
  
end